import type { CSSProperties } from 'vue';
import { createTypes, toValidableType } from 'vue-types';
import type { VueTypeValidableDef, VueTypesInterface } from 'vue-types';

// 定义扩展的类型接口
type PropTypes = VueTypesInterface & {
  readonly style: VueTypeValidableDef<CSSProperties>;
};

// 创建基础类型验证器
const newPropTypes = createTypes({
  func: undefined,
  bool: undefined,
  string: undefined,
  number: undefined,
  object: undefined,
  integer: undefined
}) as PropTypes;

// 扩展类型验证器，添加style类型
class propTypes extends newPropTypes {
  static get style() {
    return toValidableType('style', { type: [String, Object] });
  }
}

export { propTypes };
